﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GeneratorLib.DB;
using GeneratorLib.DB.Connectios;
using GeneratorLib.DB.Schemas;

namespace GeneratorCode
{
    public class Common
    {
        public static string getSingleDeclare(FieldInfo field)
        {
            return string.Format("public {0} {1} {{get;set;}}", field.FieldType.MapName, field.FieldName);
        }

        public static string getSingleDeclareForSearchModel(FieldInfo field)
        {
            string type = field.FieldType.MapName;
            if (field.Nullabled && type.ToLower().CompareTo("datetime") == 0)
                type = "string";

            return string.Format("public {0} {1} {{get;set;}}", type, field.FieldName);
        }


    }
}
